<template>
 <div class="goods-list-item" @click="itemClick">
    <img :src="goodsItem.show.img" alt="" @load="imageLoad">
    <div>
    <p>{{goodsItem.title}}</p>
    <span class="price">{{goodsItem.price}}</span>
    <span class="collect">{{goodsItem.cfav}}</span>
    </div>
 </div>
</template>

<script>
 export default {
   data () {
     return {
     }
   },
   props: {
       goodsItem: {
           type: Object,
           default() {
               return {}
           }
       }
   },
   created() {
   },
   methods: {
     imageLoad() {
      this.$bus.$emit('itemImageLoad')    

      //  if(this.$router.path.indexOf('/home')) {
      //    this.$bus.$emit('homeImageLoad')
      //  } else if (this.$router.path.indexOf('/detail')) {
      //    this.$bus.$emit('detailImageLoad')
      //  }
       
     },
     itemClick() {
       this.$router.push('/detail' + this.goodsItem.iid)
     }
   }
 }
</script>

<style scoped>

 
</style>
 